package com.xiaoshuidi.cloud.module.member.pojo.user;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaoshuidi.cloud.framework.tenant.core.db.TenantBaseDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 会员用户 DO
 * <p>
 * uk_mobile 索引：基于 {@link #mobile} 字段
 *
 * @author 芋道源码
 */
@TableName(value = "member_user", autoResultMap = true)
@KeySequence("member_user_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class MemberUser extends TenantBaseDO implements Serializable {

    private static final long serialVersionUID = 1736244703446366094L;

    @Schema(description = "主键")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "推荐人Id")
    private Long recommendId;

    @Schema(description = "企业客户id")
    private Long superId;

    @Schema(description = "用户昵称")
    private String nickname;

    @Schema(description = "用户头像")
    private String avatar;

    @Schema(description = "帐号状态")
    private Integer status;

    @Schema(description = "民族")
    private String fork;

    @Schema(description = "年龄")
    private Integer age;
    @Schema(description = "手机")
    private String mobile;

    @Schema(description = "加密后的密码")
    private String password;

    @Schema(description = "证件类型")
    private String cardType;

    @Schema(description = "证件号")
    private String cardNo;

    @Schema(description = "性别1男2女")
    private Integer gender;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "真实姓名")
    private String name;

    @Schema(description = "1.大专2本科")
    private Integer education;

    @Schema(description = "是否已实名认证")
    private Boolean authenticated;

    @Schema(description = "认证时间")
    private LocalDateTime authenticatedTime;

    @Schema(description = "会员等级")
    private String level;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate birthday;

    @Schema(description = "紧急联系人信息")
    private String emergencyContact;

    @Schema(description = "积分")
    private Integer score;

    @Schema(description = "最后登录IP")
    private String loginIp;

    @Schema(description = "最后登录时间")
    private LocalDateTime loginDate;

    @Schema(description = "第三方会员id")
    private String thirdMemberId;

    @Schema(description = "是否绑定支付标识")
    private Boolean bindFlag;

    @Schema(description = "工作单位")
    private String workUnit;

    @Schema(description = "个人地址")
    private String address;
    // TODO 芋艿：payPassword 支付密码；

    @Schema(description = "禁用说明")
    private String disableDesc;
}
